﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using K9Nano.IM.Models;


namespace K9Nano.IM.ViewModels.UserVMs
{
    public partial class UserTemplateVM : BaseTemplateVM
    {
        [Display(Name = "签名")]
        public ExcelPropety Sign_Excel = ExcelPropety.CreateProperty<User>(x => x.Sign);
        [Display(Name = "状态")]
        public ExcelPropety Online_Excel = ExcelPropety.CreateProperty<User>(x => x.Online);
        [Display(Name = "昵称")]
        public ExcelPropety Nickname_Excel = ExcelPropety.CreateProperty<User>(x => x.Nickname);
        [Display(Name = "来源")]
        public ExcelPropety App_Excel = ExcelPropety.CreateProperty<User>(x => x.AppId);
        [Display(Name = "外部ID")]
        public ExcelPropety ExternalId_Excel = ExcelPropety.CreateProperty<User>(x => x.ExternalId);
        [Display(Name = "头像")]
        public ExcelPropety Avatar_Excel = ExcelPropety.CreateProperty<User>(x => x.Avatar);
        [Display(Name = "Account")]
        public ExcelPropety ITCode_Excel = ExcelPropety.CreateProperty<User>(x => x.ITCode);
        [Display(Name = "Password")]
        public ExcelPropety Password_Excel = ExcelPropety.CreateProperty<User>(x => x.Password);
        [Display(Name = "Email")]
        public ExcelPropety Email_Excel = ExcelPropety.CreateProperty<User>(x => x.Email);
        [Display(Name = "Name")]
        public ExcelPropety Name_Excel = ExcelPropety.CreateProperty<User>(x => x.Name);
        [Display(Name = "Sex")]
        public ExcelPropety Sex_Excel = ExcelPropety.CreateProperty<User>(x => x.Sex);
        [Display(Name = "CellPhone")]
        public ExcelPropety CellPhone_Excel = ExcelPropety.CreateProperty<User>(x => x.CellPhone);
        [Display(Name = "HomePhone")]
        public ExcelPropety HomePhone_Excel = ExcelPropety.CreateProperty<User>(x => x.HomePhone);
        [Display(Name = "Address")]
        public ExcelPropety Address_Excel = ExcelPropety.CreateProperty<User>(x => x.Address);
        [Display(Name = "ZipCode")]
        public ExcelPropety ZipCode_Excel = ExcelPropety.CreateProperty<User>(x => x.ZipCode);
        [Display(Name = "IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<User>(x => x.IsValid);

	    protected override void InitVM()
        {
            App_Excel.DataType = ColumnDataType.ComboBox;
            App_Excel.ListItems = DC.Set<ChatApp>().GetSelectListItems(LoginUserInfo?.DataPrivileges, null, y => y.Name);
        }

    }

    public class UserImportVM : BaseImportVM<UserTemplateVM, User>
    {

    }

}
